home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / ams__l~1.zoo / man / mobilesp.man < prev    next >
Encoding:
Text File  |  1993-09-12  |  3.2 KB  |  105 lines

  1.                         ATARI MACHINE SPECIFIC LIBRARY
  2.  
  3.  
  4.  
  5. NAME
  6.      MobileSprite - a derived Sprite that moves by itself
  7.  
  8. SYNOPSIS
  9.      #include <MobileSprite.h>
  10.  
  11.      class MobileSprite : public Sprite
  12.      enum BoundaryEffect
  13.      const ...
  14.  
  15. DESCRIPTION
  16.      Many times a sprite is used, it is moved about the screen at
  17.      certain speeds, and bounded in a rectangle.  This module provides
  18.      such a sprite.
  19.  
  20. CLASSES
  21.      A MobileSprite is just like a normal Sprite, but it can be set in
  22.      motion and moved with a simple Move() member call.
  23.  
  24. CONSTANTS
  25.      The following constants are used for specifying boundary edges:
  26.        HitNorth, HitSouth, HitEast, HitWest.
  27.  
  28. TYPES
  29.      enum BoundaryEffect
  30.        Used to define the effect caused by a MobileSprite interracting
  31.        with its boundary.
  32.          Bounce - Reverse the x or y speed component as necessary,
  33.                   possibly slowing down in the process according to
  34.                   the Bounciness (See AtBoundary below).
  35.          Wrap - Move to the othe side of the range and continue with
  36.                   the same speed.
  37.          Stop - Stop at the boundary.
  38.                   The x and y components stop separately.
  39.          Watch - Do nothing - it is then up to the programmer to use
  40.                   the return value from the member Move() to decide
  41.                   what to do.
  42.  
  43. CLASS MEMBERS
  44.   MobileSprite::
  45.      MobileSprite(Incarnation **Them,int Count)
  46.      MobileSprite(Incarnation *OnlyOne)
  47.      MobileSprite(short maxinca)
  48.      MobileSprite(const char *filename)
  49.        As per Sprite:: constructors.
  50.  
  51.      void Accelerate(int x, int y)
  52.        Speed up by the given x and y amounts.
  53.  
  54.      bool Stationary()
  55.        TRUE if the sprite is not moving.
  56.  
  57.      void Speed(int x, int y)
  58.      void XSpeed(int)
  59.      void YSpeed(int)
  60.      int XSpeed()
  61.      int YSpeed()
  62.        Set/inspect the x and y component speeds.
  63.  
  64.      void Range(int minX, int minY, int maxX, int maxY)
  65.        Set the area in which the sprite may move.
  66.  
  67.      short Move()
  68.        Move the sprite.  The value returned specifies any edges it
  69.        interacted with.  (See enum BoundaryEffect)
  70.  
  71.      void Unmove()
  72.        Undo the previous move.  Usually used in response to a boundary
  73.        interraction.
  74.  
  75.      void Rebound(short Walls)
  76.        Undo and rebound against given walls
  77.  
  78.      void Frictate(short fric)
  79.        Slow down by fric 256ths.  This works best if the sprite is
  80.        scaled highly, since that gives more bits for fractional speeds.
  81.  
  82.      void AtBoundary(BoundaryEffect, short Bouncy=256)
  83.      void AtBoundary(BoundaryEffect North, BoundaryEffect South,
  84.                BoundaryEffect East, BoundaryEffect West, short Bouncy=256)
  85.        Define the behaviour required when a sprite interracts with the
  86.        boundary of its Range.
  87.  
  88. SEE ALSO
  89.      Sprite
  90.  
  91. AUTHOR
  92.      Warwick Allison, 1992.
  93.      warwick@cs.uq.oz.au
  94.  
  95. COPYING
  96.      This functionality is part of the Atari Machine Specific Library,
  97.      and is Copyright 1992 by Warwick W. Allison.
  98.  
  99.      The Atari Machine Specific Library is free and protected under the
  100.      GNU Library General Public License.
  101.  
  102.      You are free to copy and modify these sources, provided you acknowledge
  103.      the origin by retaining this notice, and adhere to the conditions
  104.      described in the GNU LGPL.
  105.